# made by Kamil Cukrowski <kamil@dyzio.pl>
# licensed under Beerware License.

include_files=msgserv.h
lib_files=libmsgserv.so

INSTALL_DIR=/usr/local/

CFLAGS=-Wall -O2

all: libmsgserv.so

libmsgserv.so: msgserv.o
	gcc $(CFLAGS) -shared msgserv.o -o libmsgserv.so

msgserv.o: msgserv.h msgserv.c
	gcc $(CFLAGS) -fPIC -c msgserv.c -o msgserv.o
	
install:
	install $(lib_files) $(INSTALL_DIR)/lib
	install $(include_files) $(INSTALL_DIR)/include

uninstall:
	cd $(INSTALL_DIR)/lib && rm -f $(lib_files)
	cd $(INSTALL_DIR)/include && rm -f $(include_files) 

clean:
	rm *.o || true


distclean: clean
	rm *.o $(lib_files) || true


